<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/vue.js" type="text/javascript" charset="UTF-8"></script>
	</head>
	<body>
	<div id="dox">
	 <input v-model="a"/>
		<button @click='add'>添加</button>
		<ul>
			<li v-for="(list,index) in lists" v-bind:key="list">
				{{list.b}} 
			<button v-on:click="lists.splice(index, 1)">删除</button>
			</li>
		</ul>
	</div>
	<script>
	var vm = new Vue({
	  el:"#dox",
	  data:{
			a:"",
		    lists:[]
	  },
	  methods:{
		  add:function(){
				this.lists.push({
				  b:this.a
			  })
		  },
	  }	
	})
	</script>
	</body>
</html>









<!-- <body>
<div id="app">
 <input v-model="newAddText" placeholder="请输入要添加的内容" />
	<button @click='addNewList'>添加</button>
	<ul>
		<li  v-for='(list,index) in lists' v-bind:key='list.id'>
			{{list.title}}  <button v-on:click='lists.splice(index, 1)'>删除</button>
		</li>
	</ul>
</div>
 
<script>
 
var vm = new Vue({
  el: '#app',
  data: {
  newAddText:'',
	  lists:[
		  {id:1,title:'手机号码'},
		  {id:2,title:'qq号'},
		  {id:3,title:'姓名'},
	  ],
	  nextTodoId: 4
  },
  methods:{
	  addNewList:function(){
		  this.lists.push({
			  id:this.nextTodoId++,
			  title:this.newAddText
		  })
		  this.newAddText=''
	  }
  }	
})
 
</script>
</body>
 -->